#include <math.h>
#include <stdio.h>
#include <vegas.h>
#include <stdlib.h>

#define DIMENSION 2
#define NITER 2
#define FUNCTIONS 5
#define ITERATIONS 10000
#define NTHREADS 4
#define NEPS 0
#ifndef PI
#define PI     3.14159265358979323846
#endif
double reg[2*DIMENSION]= {0,0,1,1};
void func (double k[DIMENSION], double f[FUNCTIONS]) {
//double Pi=PI;
double u=k[0];
double t=k[1];
f[0]=t*(1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u) + 1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)); 
f[1]=t*(0.5*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u)*log(1.0 - u) + 0.5*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u)*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)) + 0.5*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(1.0 - t*u) + 0.5*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*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.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(1.0 - t*u) + 0.5*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*log(u);

f[3]=0.166666666666667*t*(0.125*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 - u)*log(1.0 - u)*log(1.0 - u))*(1.0 - 0.5*t*u) + 0.125*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u) + 0.125*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(1.0 - t*u)*log(1.0 - t*u)*log(1.0 - t*u))*(1.0 - 0.5*u) + 0.125*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u) + 0.375*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 - u)*log(1.0 - u))*(1.0 - 0.5*t*u)*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)) + 0.375*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u)*log(1.0 - u) + 0.375*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(1.0 - t*u)*log(1.0 - t*u))*(1.0 - 0.5*u)*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)) + 0.375*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(1.0 - t*u)) + 0.125*t*(log(u)*log(u))*(0.5*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t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5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u) + 0.5*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u)*log(1.0 - u)*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)) + 0.5*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(1.0 - t*u)*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*log(u) + 0.0208333333333333*t*(log(u)*log(u)*log(u))*(1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u) + 1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u));
f[4]=0.0416666666666667*t*(0.0625*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 - u)*log(1.0 - u)*log(1.0 - u)*log(1.0 - u))*(1.0 - 0.5*t*u) + 0.0625*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u) + 0.0625*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(1.0 - t*u)*log(1.0 - t*u)*log(1.0 - t*u)*log(1.0 - t*u))*(1.0 - 0.5*u) + 0.0625*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u) + 0.25*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 - u)*log(1.0 - u)*log(1.0 - u))*(1.0 - 0.5*t*u)*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)) + 0.25*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u)*log(1.0 - u) + 0.25*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(1.0 - t*u)*log(1.0 - t*u)*log(1.0 - t*u))*(1.0 - 0.5*u)*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)) + 0.25*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(1.0 - t*u) + 0.375*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 - u)*log(1.0 - u))*(log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u) + 0.375*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(1.0 - t*u)*log(1.0 - t*u))*(log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)) + 0.0625*t*(log(u)*log(u))*(0.25*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 - u)*log(1.0 - u))*(1.0 - 0.5*t*u) + 0.25*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u) + 0.25*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(1.0 - t*u)*log(1.0 - t*u))*(1.0 - 0.5*u) + 0.25*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u) + 0.5*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u)*log(1.0 - u)*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)) + 0.5*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(1.0 - t*u)*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))) + 0.00260416666666667*t*(log(u)*log(u)*log(u)*log(u))*(1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u) + 1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)) + 0.0208333333333333*t*(log(u)*log(u)*log(u))*(0.5*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u)*log(1.0 - u) + 0.5*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u)*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)) + 0.5*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(1.0 - t*u) + 0.5*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))) + 0.0833333333333333*t*(0.125*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 - u)*log(1.0 - u)*log(1.0 - u))*(1.0 - 0.5*t*u) + 0.125*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u) + 0.125*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(1.0 - t*u)*log(1.0 - t*u)*log(1.0 - t*u))*(1.0 - 0.5*u) + 0.125*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u) + 0.375*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 - u)*log(1.0 - u))*(1.0 - 0.5*t*u)*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)) + 0.375*1/((1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u))*log(1.0 + t*(0.5 - 0.5*u)*(1.0 - 0.5*t*u)))*(1.0 - 0.5*t*u)*log(1.0 - u) + 0.375*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(1.0 - t*u)*log(1.0 - t*u))*(1.0 - 0.5*u)*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)) + 0.375*1/((t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u))*log(t + (0.5 - 0.5*t*u)*(1.0 - 0.5*u)))*(1.0 - 0.5*u)*log(1.0 - t*u))*log(u);

 }




int t_gfsr_k;
unsigned int t_gfsr_m[SR_P];
double gfsr_norm;


int main(int argc, char **argv)
{
  int i;
  long long npoints;
  int nthreads;
  int niter;
  if(argc >= 2)
    {
      npoints = atoll(argv[1]);

    }
  else 
    {
      npoints = ITERATIONS;
    }

  if(argc >= 3)
    {
      nthreads = atoi(argv[2]);

    }
  else 
    {
      nthreads = NTHREADS;
    }
    
  if(argc >= 4)
    {
      niter = atoi(argv[3]);

    }
  else 
    {
      niter = NITER;
    }
  
  printf("%i",FUNCTIONS);
  double estim[FUNCTIONS];   /* estimators for integrals                     */
  double std_dev[FUNCTIONS]; /* standard deviations                          */
  double chi2a[FUNCTIONS];   /* chi^2/n                                      */

  vegas(reg, DIMENSION, func,
        0, npoints/10, 5, NPRN_INPUT | NPRN_RESULT,
        FUNCTIONS, 0, nthreads,
        estim, std_dev, chi2a);
  vegas(reg, DIMENSION, func,
        2, npoints , niter, NPRN_INPUT | NPRN_RESULT,
        FUNCTIONS, 0, nthreads,
        estim, std_dev, chi2a);
double delta= std_dev[0]/estim[0];
//printf ("result = %20.18g\\nstd_dev = %20.18g\\ndelta = %20.18g\\n", estim[0], std_dev[0], delta);
  printf ("Result %d: %g +/- %g delta=%g\n",NEPS, estim[0], std_dev[0], delta);
  for (i=1; i<FUNCTIONS; ++i)
    {
      printf("Result %i:\t%g +/- %g  \tdelta=%g\n", i, estim[i], std_dev[i],std_dev[i]/estim[i]);
    }
    return(0);
}
